package com.zhengshang.api.service.impl;

import java.math.BigDecimal;
import java.util.List;

import com.zhengshang.api.domain.AppBalanceRecord;
import com.zhengshang.api.mapper.AppBalanceRecordMapper;
import com.zhengshang.common.constant.app.AppConstant;
import com.zhengshang.common.core.domain.entity.SysUser;
import com.zhengshang.common.utils.DateUtils;
import com.zhengshang.common.utils.PartnerLevelUtils;
import com.zhengshang.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.api.mapper.AppContributionRecordMapper;
import com.zhengshang.api.domain.AppContributionRecord;
import com.zhengshang.api.service.IAppContributionRecordService;

/**
 * 贡献值变更记录Service业务层处理
 * 
 * @author zhengshang
 * @date 2021-06-01
 */
@Service
public class AppContributionRecordServiceImpl implements IAppContributionRecordService 
{
    @Autowired
    private AppContributionRecordMapper appContributionRecordMapper;
    @Autowired
    private SysUserMapper sysUserMapper;
    @Autowired
    private AppBalanceRecordMapper appBalanceRecordMapper;

    /**
     * 查询贡献值变更记录
     * 
     * @param id 贡献值变更记录ID
     * @return 贡献值变更记录
     */
    @Override
    public AppContributionRecord selectAppContributionRecordById(Long id)
    {
        return appContributionRecordMapper.selectAppContributionRecordById(id);
    }

    /**
     * 查询贡献值变更记录列表
     * 
     * @param appContributionRecord 贡献值变更记录
     * @return 贡献值变更记录
     */
    @Override
    public List<AppContributionRecord> selectAppContributionRecordList(AppContributionRecord appContributionRecord)
    {
        return appContributionRecordMapper.selectAppContributionRecordList(appContributionRecord);
    }

    /**
     * 新增贡献值变更记录
     * 
     * @param appContributionRecord 贡献值变更记录
     * @return 结果
     */
    @Override
    public int insertAppContributionRecord(AppContributionRecord appContributionRecord)
    {
        appContributionRecord.setCreateTime(DateUtils.getNowDate());
        return appContributionRecordMapper.insertAppContributionRecord(appContributionRecord);
    }

    /**
     * 修改贡献值变更记录
     * 
     * @param appContributionRecord 贡献值变更记录
     * @return 结果
     */
    @Override
    public int updateAppContributionRecord(AppContributionRecord appContributionRecord)
    {
        appContributionRecord.setUpdateTime(DateUtils.getNowDate());
        return appContributionRecordMapper.updateAppContributionRecord(appContributionRecord);
    }

    /**
     * 批量删除贡献值变更记录
     * 
     * @param ids 需要删除的贡献值变更记录ID
     * @return 结果
     */
    @Override
    public int deleteAppContributionRecordByIds(Long[] ids)
    {
        return appContributionRecordMapper.deleteAppContributionRecordByIds(ids);
    }

    /**
     * 删除贡献值变更记录信息
     * 
     * @param id 贡献值变更记录ID
     * @return 结果
     */
    @Override
    public int deleteAppContributionRecordById(Long id)
    {
        return appContributionRecordMapper.deleteAppContributionRecordById(id);
    }
}
